package com.xigua.JucOfBeautiful.chapterOne.threadLocal1_11;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: threadlocal 不支持继承性
 * @date 2022/1/2318:46
 */
public class ThreadLocalTest2 {
    static InheritableThreadLocal<String> threadLocal = new InheritableThreadLocal<>();

    public static void main(String[] args) {
        threadLocal.set("threadMain local variable");
        Thread threadOne = new Thread(()->{
            System.out.println("ThreadOne remove after"+" : "+threadLocal.get());
        });

        threadOne.start();
        System.out.println(threadLocal.get());
    }

}
